package com.li.singleton;

import com.li.thread.MyThread;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class Test {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        while (true) {
            MyThread myThread = new MyThread();
            FutureTask<String> futureTask = new FutureTask<>(myThread);
            new Thread(futureTask).start();
            System.out.println(futureTask.get());
        }
    }
}
